﻿namespace ConsoleApp2
{
    internal class Program
    {

        public static bool IsSleep = true;

        static void Main(string[] args)
        {
            TaskTest();
            Console.WriteLine("Hello, World!");
            Console.ReadLine(); 
        }


        public async static Task TaskTest()
        {
            int SleepTime = 0;
            while (true)
            {
                if (IsSleep)
                {
                    SleepTime = 1;
                }
                else
                {
                    SleepTime = 5;
                }
                IsSleep = !IsSleep;

                Console.WriteLine($"将会休眠{SleepTime}秒");
                await Task.Delay(SleepTime * 1000);
            }

        }
    }
}
